import {createRouter, createWebHashHistory} from 'vue-router'

//在 vue-router新版本中，需要使用createRouter来创建路由。旧：Router
const router = createRouter({
    //指定路由的模式，此处使用的是hash模式
    history:createWebHashHistory(),
    //路由地址
    routes:[
        {
            path: '/',
            name: 'home',
            component: () => import('@/views/Home.vue')
        },
        {
            path: '/demo',
            name: 'demo',
            component: () => import('@/views/Demo.vue')
        },
        {
            path: '/list',
            name: 'list',
            component: () => import('@/views/List.vue')
        },
        {
            path: '/swipe',
            name: 'swipe',
            component: () => import('@/views/Swipe.vue')
        },
        {
            path: '/select',
            name: 'select',
            component: () => import('@/views/Select.vue')
        },
        {
            path: '/collapse',
            name: 'collapse',
            component: () => import('@/views/Collapse.vue')
        },
    ]
})

export default router